package com.kai.service.wechat.handle;

import com.kai.service.data.dto.wechat.receive.TextMessageReceiveDto;
import com.kai.service.data.dto.wechat.reply.TextMessageReplyDto;
import com.kai.service.enums.WechatMsgTypeEnum;
import org.springframework.stereotype.Component;

@Component
public class TextMessageHandle extends MessageHandle<TextMessageReceiveDto> {

    @Override
    protected Object messageAnalysis(TextMessageReceiveDto message) {
        String content = message.getContent();

        TextMessageReplyDto textMessageReplyDto = new TextMessageReplyDto();
        textMessageReplyDto.setMsgType(WechatMsgTypeEnum.text);
        textMessageReplyDto.setContent(content + "!");

        return messageReply(message, textMessageReplyDto);
    }

}
